Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update typecasting.md #4222

Merged
merged 2 commits into from
Dec 4, 2024
Merged

Update typecasting.md #4222

merged 2 commits into from
Dec 4, 2024

Conversation

soerenwolfers
Copy link
Collaborator

@soerenwolfers soerenwolfers commented Dec 1, 2024

Fixes duckdb/duckdb#13847 (sadly).

From what I can tell, BOOL -> INTEGERTYPES is the only example of this special type of casting?

Maybe one should get one final confirmation whether it's worth documenting this special type of cast rather than simply dropping it and gaining more PostgreSQL compatibility for it (just to reiterate: I'm all for implicit casts to programatically selected parent types, I just question the value of allowing more implicit casts in this situation than in other implicit cast situations.)

By the way: do you have the HTML for the typecasting matrix? I'd like to resolve #2791 too by adding INTEGER_LITERAL / STRING_LITERAL / NUMERIC_LITERAL to the table (at which point I'd also add the "combination cast" from bool to int to the table)

@szarnyasg
Copy link
Collaborator

IIRC the typecasting matrix was a Google Sheets sheet. I wanted to re-do it in Markdown as three column table (from, to, what type of cast is allowed) but did not get to this so far. Would you be interested in picking this up?

@soerenwolfers
Copy link
Collaborator Author

Yeah, can do. Long-format is more in the spirit of SQL too.

@soerenwolfers
Copy link
Collaborator Author

Although... are you sure you want a table with 576 entries in the docs? Maybe should that table only include positive entries? That'd be around 100.

@szarnyasg
Copy link
Collaborator

Yeah, that sounds reasonable.

@soerenwolfers
Copy link
Collaborator Author

@szarnyasg From my perspective this PR is ready to go if you think the contents are right. I'll make a separate PR for the casting matrix when I have time

@szarnyasg
Copy link
Collaborator

Sure. I reviewed the text and it's great, merging now.

@szarnyasg szarnyasg merged commit 34fd212 into duckdb:main Dec 4, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Boolean implicitly cast to integer in list literal Inconsistency in the Casting Operation Matrix?
2 participants